package com.mco.config.guava;

import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

/**
 * @author ：liao.wei
 * @date ：2023/9/30 16:32
 * @package : com.mco.config.guava
 */
public class GuavaUtil {
	
	public static void main(String[] args) {
		// 创建Guava过滤器对象
		BloomFilter<Integer> bloomFilter = BloomFilter.create(Funnels.integerFunnel(), 100);
		
		//判断指定元素是否存在
		System.out.println(bloomFilter.mightContain(1));
		
		// 将元素新增进入过滤器
		bloomFilter.put(1);
		System.out.println(bloomFilter.mightContain(1));
		
	}
}
